<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>五彩小案例</title>
  <style>
    .nav a {
      /* 转换为行内块元素 */
      display: inline-block;

      width: 120px;
      height: 58px;

      background: pink;

      text-align: center;
      line-height: 50px;
      color: #ffffff;
      text-decoration: none;


    }

    .nav .bg1 {
      background: url(bg1.png) no-repeat;
      background-size: 100% 100%;
    }


    .nav .bg2 {
      background: url(bg2.png) no-repeat;
      background-size: 100% 100%;
    }

    .nav .bg3 {
      background: url(bg3.png) no-repeat;
      background-size: 100% 100%;
    }

    .nav .bg4 {
      background: url(bg4.png) no-repeat;
      background-size: 100% 100%;
    }

    .nav .bg5 {
      background: url(bg5.png) no-repeat;
      background-size: 100% 100%;
    }

    .nav .bg1:hover {
      background-image: url(bg2.png);
    }

    .nav .bg2:hover {
      background-image: url(bg3.png);
    }

    .nav .bg3:hover {
      background-image: url(bg4.png);
    }

    .nav .bg4:hover {
      background-image: url(bg5.png);
    }

    .nav .bg5:hover {
      background-image: url(bg1.png);
    }
  </style>
</head>

<body>

  <div class="nav">
    <a href="#" class="bg1">五彩导航</a>
    <a href="#" class="bg2">五彩导航</a>
    <a href="#" class="bg3">五彩导航</a>
    <a href="#" class="bg4">五彩导航</a>
    <a href="#" class="bg5">五彩导航</a>
  </div>

</body>

</html>